<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
    <script>
        //声明一个add函数，实现两个数的和，将和返回
        function add(a,b){
            console.log("add执行....",a,b);
            return a+b;
        }

        //执行add函数
        let sum=add(1,2);
        console.log(sum);

        console.log(add(1));//add执行.... 1 undefined
        console.log(add(1,2,3));//add执行.... 1 2

        function add(){
            console.log("后来者:add执行....");  
        }
    </script>
</head>
<body>
    
</body>
</html>